sum=0
for i in range(1000,10000):
    a=i
    q=a%10
    w=a//10%10
    e=a//100%10
    r=a//1000%10
    if(q*q*q*q+w*w*w*w+e*e*e*e+r*r*r*r==a):
        print('%d是玫瑰花数\t'%a)
        sum=sum+1
print('玫瑰花数总计：%d'%sum)
        
